import { Theme } from '../interface'

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
export const createTabs = (theme: Theme, compatibilityMode?: boolean) => ({
  rootColorText: compatibilityMode
    ? theme.colourway.onBackgroundHigh
    : theme.sys.color.onBackgroundHigh,
  tabColorText: compatibilityMode
    ? theme.colourway.onBackgroundHigh
    : theme.sys.color.onBackgroundMedium,
  tabColorTextDisabled: compatibilityMode
    ? theme.colourway.onBackgroundDisabled
    : theme.sys.color.disabledHigh,
  tabColorTextHover: compatibilityMode
    ? theme.colourway.onBackgroundMedium
    : theme.sys.color.onBackgroundMedium,
  tabColorBackgroundHover: compatibilityMode
    ? theme.colourway.mono02
    : theme.sys.color.onBackgroundOverlayHover,
  tabColorShadowFocus: compatibilityMode
    ? theme.colourway.focus
    : theme.sys.color.focus,
  tabColorTextSelected: compatibilityMode
    ? theme.colourway.onBackgroundHigh
    : theme.sys.color.onBackgroundHigh,
  tabIndicatorColorBackgroundSelected: compatibilityMode
    ? theme.colourway.primary
    : theme.sys.color.primaryAlpha,
  contentColorShadow: compatibilityMode
    ? theme.colourway.mono04
    : theme.sys.color.separationMinor,
  tabColorShadowFilledSelected: compatibilityMode
    ? theme.colourway.mono02
    : theme.sys.color.separationMinor,
  tabColorShadowFilledFocus: compatibilityMode
    ? theme.colourway.focus
    : theme.sys.color.focus,
  tabColorBackgroundFilledSelected: compatibilityMode
    ? theme.colourway.background02
    : theme.sys.color.backgroundBeta,
  contentColorBackgroundFilled: compatibilityMode
    ? theme.colourway.background02
    : theme.sys.color.backgroundBeta,
  contentColorBorderFilled: compatibilityMode
    ? theme.colourway.mono02
    : theme.sys.color.separationMinor,

  tabShapeBorderRadiusTopLeftHorizontal: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusTopRightHorizontal: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomLeftHorizontal: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomRightHorizontal: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,

  tabShapeBorderRadiusTopLeftVertical: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusTopRightVertical: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomLeftVertical: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomRightVertical: compatibilityMode
    ? 1
    : theme.sys.shape.borderRadiusNone,

  tabShapeBorderRadiusTopLeftFilledVertical: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  tabShapeBorderRadiusTopRightFilledVertical: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomLeftFilledVertical: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  tabShapeBorderRadiusBottomRightFilledVertical: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,

  tabShapeBorderRadiusTopLeftFilledHorizontal: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  tabShapeBorderRadiusTopRightFilledHorizontal: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  tabShapeBorderRadiusBottomLeftFilledHorizontal: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  tabShapeBorderRadiusBottomRightFilledHorizontal: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,

  contentShapeBorderRadiusTopLeftFilledVertical: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  contentShapeBorderRadiusTopRightFilledVertical: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  contentShapeBorderRadiusBottomLeftFilledVertical: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  contentShapeBorderRadiusBottomRightFilledVertical: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,

  contentShapeBorderRadiusTopLeftFilledHorizontal: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  contentShapeBorderRadiusTopRightFilledHorizontal: compatibilityMode
    ? 0
    : theme.sys.shape.borderRadiusNone,
  contentShapeBorderRadiusBottomLeftFilledHorizontal: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,
  contentShapeBorderRadiusBottomRightFilledHorizontal: compatibilityMode
    ? 4
    : theme.sys.shape.borderRadiusMd,

  tabTypographyFontFamily: compatibilityMode
    ? theme.typography.fontFamily.text
    : theme.sys.typography.titleMd.fontFamily,
  tabTypographyFontWeight: compatibilityMode
    ? theme.typography.fontWeight.regular
    : theme.sys.typography.titleMd.fontWeight,
  tabTypographyFontSize: compatibilityMode
    ? theme.typography.fontSize.subtitle1
    : theme.sys.typography.titleMd.fontSize,
  tabTypographyLineHeight: compatibilityMode
    ? theme.typography.lineHeight.subtitle1
    : theme.sys.typography.titleMd.lineHeight,
  tabTypographyLetterSpacing: compatibilityMode
    ? theme.typography.letterSpacing.subtitle1
    : theme.sys.typography.titleMd.letterSpacing,
})
